<template>
  <div class="app-container">
    <wise-crud ref="wise-crud" :urls="urls" :fields="fields" />
  </div>
</template>

<script>
  import WiseCrud from '@/components/Crud/wiseCrud'
  export default {
    name: 'ConfigManage',
    components: {
      WiseCrud
    },
    data() {
      return {
        urls: {
          list: '/api/v1/welder-sbtx-second/sysconfig',
          add: '/api/v1/welder-sbtx-second/sysconfig/create',
          show: '/api/v1/welder-sbtx-second/sysconfig/show/',
          update: '/api/v1/welder-sbtx-second/sysconfig-comb/update/',
          delete: '/api/v1/welder-sbtx-second/sysconfig/remove/'
        },
        fields: [{
            label: '序号',
            type: 'index',
            use: ['table']
          },
          {
            label: '配置名称',
            prop: 'name',
            type: 'text',
            maxlength: 20,
            rules: [{
              required: true,
              message: '请输入配置名称',
              trigger: 'blur'
            }],
            placeholder: '请输入配置名称',
            use: ['table', 'add', 'view', 'edit', 'search']
          },
          {
            label: '配置编码',
            prop: 'code',
            type: 'text',
            maxlength: 20,
            rules: [{
              required: true,
              message: '请输入配置编码',
              trigger: 'blur'
            }],
            placeholder: '请输入配置编码',
            use: ['table', 'add', 'view', 'edit', 'search']
          },
          {
            label: '配置内容',
            prop: 'content',
            type: 'textarea',
            maxlength: 500,
            rules: [{
              required: true,
              message: '请输入配置内容',
              trigger: 'blur'
            }],
            placeholder: '请输入配置内容',
            use: ['table', 'add', 'view', 'edit', 'search']
          },
          {
            label: '配置说明',
            prop: 'instructions',
            type: 'textarea',
            maxlength: 500,
            rules: [{
              required: true,
              message: '请输入配置说明',
              trigger: 'blur'
            }],
            placeholder: '请输入配置说明',
            use: ['table', 'add', 'view', 'edit', 'search']
          },
          {
            label: '备注',
            prop: 'remark',
            type: 'textarea',
            maxlength: 500,
            placeholder: '请输入备注',
            use: ['add', 'view', 'update', 'edit', 'search']
          },
          {
            label: '文件',
            prop: 'files',
            type: 'file',
            uploadType: 'file',
            labelWidth: '120px',
            limit: 1,
            desc: '请上传文件',
            use: ['add', 'view', 'edit']
          },
          {
            label: '操作',
            type: 'handle',
            use: ['table'],
            handle: ['edit', 'view', 'delete']
          }
        ]
      }
    },
    methods: {}
  }
</script>

<style>

</style>